Skip to content

v4l-utils: fix cross-compilation#429900

Merged
uninsane merged 1 commit intoNixOS:stagingfrom
avnik:avnik/v4l-utils-cross-fix
Aug 6, 2025
Merged

v4l-utils: fix cross-compilation#429900
uninsane merged 1 commit intoNixOS:stagingfrom
avnik:avnik/v4l-utils-cross-fix

Conversation

@avnik
Copy link
Contributor

@avnik avnik commented Jul 31, 2025

Fix cross-compilation (aarch64-multiplatform tested)

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jul 31, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jul 31, 2025
@avnik avnik force-pushed the avnik/v4l-utils-cross-fix branch 3 times, most recently from ce86f2a to 159adab Compare July 31, 2025 17:53
@prusnak
Copy link
Member

prusnak commented Jul 31, 2025

Since this is a big rebuild, this should target staging

Signed-off-by: Alexander V. Nikolaev <avn@avnik.info>
@avnik avnik force-pushed the avnik/v4l-utils-cross-fix branch from 159adab to 067bdc6 Compare August 1, 2025 12:10
@avnik avnik changed the base branch from master to staging August 1, 2025 12:10
@nixpkgs-ci nixpkgs-ci bot closed this Aug 1, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Aug 1, 2025
@avnik
Copy link
Contributor Author

avnik commented Aug 1, 2025

@prusnak I agree, moved to staging as requested

Copy link
Contributor

@Yarny0 Yarny0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some tests on x86_64-linux, after cherry-picking the commit onto current nixos-unstable

  • The output of v4l2-ctl --list-formats-ext -d /dev/video${NUMBER} seems alright.
  • dvbv5-zap --adapter=${ADAPTER} --channel=channels.dvbv5 --pat --output=/tmp/output.ts ${CHANNEL_NAME} records some TV into the output file as expected (tested with dvb-t2 and dvb-s2).
  • qv4l2 starts up and looks nice (I haven't tested any hardware access with this program).
  • dtv-scan-tables builds (it uses ${v4l-utils}/bin/dvb-format-convert during the build).
  • dvbv5-scan --get_frontend --nit ${dtv-scan-tables}/share/dvbv5/dvb-t/${SOME_TRANSPONDER_FILE} finds a lot of dvb-t channels, as it should.
  • mpv av://v4l2:/dev/video${NUMBER} shows a webcam's video stream.
  • I'm regularly using something like ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -input_format mjpeg -i /dev/video${NUMBER} -vf 'scale=4*iw:-1,crop=1280:720,format=yuv420p' -f v4l2 /dev/video${NUMBER_LOOPBACK} to zoom my webcam's picture and feed it into a v4l2-loopback device. This still works.
  • mpv dvb://${CHANNEL} works (tested with dvb-s).

I can't judge the cross-compiling mechanism; superficially it looks alright to me.

Dear @avnik: Thanks for your contribution. Would you like to join me as a maintainer of this package? You seem to know a lot about its build process ... likely more than I do.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Aug 1, 2025
@avnik
Copy link
Contributor Author

avnik commented Aug 3, 2025

@Yarny0 thanks for offering, but I use it only indirectly as mpv dependency, this fix is part of my routine duty supporting cross-compilation in downstream distro (ghaf). But you always could enlist my help if have any build issues here.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/2495

qtbase,
libGLU,
wrapQtAppsHook,
qt6Packages,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does qt5 -> qt6 have to do with fixing cross-compilation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjornfor It already qt6, I just streamlined it to plain callPackages (it correct if I remember right, and allow move to by-name hierarchy in future)

-   v4l-utils = qt6.callPackage ../os-specific/linux/v4l-utils { };
+   v4l-utils = callPackage ../os-specific/linux/v4l-utils { };

@uninsane uninsane merged commit 272a27b into NixOS:staging Aug 6, 2025
34 of 52 checks passed
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request Sep 3, 2025
NixOS/nixpkgs#429900

already merged to nixos-unstable

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request Sep 3, 2025
NixOS/nixpkgs#429900

already merged to nixos-unstable.

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request Sep 3, 2025
NixOS/nixpkgs#429900

already merged to nixos-unstable.

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
brianmcgillion added a commit to tiiuae/ghaf that referenced this pull request Sep 4, 2025
NixOS/nixpkgs#429900

already merged to nixos-unstable.

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants